<html>
<head><meta charset="utf-8"><title>Any tips on debugging reproducible builds? · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Any.20tips.20on.20debugging.20reproducible.20builds.3F.html">Any tips on debugging reproducible builds?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="199863854"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Any%20tips%20on%20debugging%20reproducible%20builds%3F/near/199863854" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Elichai Turkel <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Any.20tips.20on.20debugging.20reproducible.20builds.3F.html#199863854">(Jun 05 2020 at 11:36)</a>:</h4>
<p>Hi,<br>
I'm trying to reproduce the same binary under the same docker, but I'm getting different results on different computers (with the same docker file)<br>
Any tips on how to debug? I tried dumping the binaries to hex(xxd) and diffing but the differences are too big, are there any Intermediate artifacts I can compare? (ie the built dependencies?)<br>
<span class="user-mention" data-user-id="124288">@oli</span>  (I know you tackled this in the past)</p>



<a name="199865361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Any%20tips%20on%20debugging%20reproducible%20builds%3F/near/199865361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> zeroexcuses <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Any.20tips.20on.20debugging.20reproducible.20builds.3F.html#199865361">(Jun 05 2020 at 11:53)</a>:</h4>
<p>Is Cargo.lock the same? (i.e. is it possible that in between running the two builds, some dependency got updated)</p>



<a name="199866083"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Any%20tips%20on%20debugging%20reproducible%20builds%3F/near/199866083" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Elichai Turkel <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Any.20tips.20on.20debugging.20reproducible.20builds.3F.html#199866083">(Jun 05 2020 at 12:01)</a>:</h4>
<p>Yep, it's checked in,<br>
I think <code>cargo install</code> ignores the Cargo.lock :O</p>



<a name="199867108"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Any%20tips%20on%20debugging%20reproducible%20builds%3F/near/199867108" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Elichai Turkel <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Any.20tips.20on.20debugging.20reproducible.20builds.3F.html#199867108">(Jun 05 2020 at 12:13)</a>:</h4>
<p>Found this <a href="https://github.com/rust-lang/cargo/issues/7169">https://github.com/rust-lang/cargo/issues/7169</a> :(</p>



<a name="199869040"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Any%20tips%20on%20debugging%20reproducible%20builds%3F/near/199869040" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Any.20tips.20on.20debugging.20reproducible.20builds.3F.html#199869040">(Jun 05 2020 at 12:32)</a>:</h4>
<p><code>cargo install --locked</code> should work.</p>



<a name="199875856"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Any%20tips%20on%20debugging%20reproducible%20builds%3F/near/199875856" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> zeroexcuses <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Any.20tips.20on.20debugging.20reproducible.20builds.3F.html#199875856">(Jun 05 2020 at 13:30)</a>:</h4>
<p><span class="user-mention" data-user-id="249222">@Elichai Turkel</span> :</p>
<ol>
<li>On the same machine, with the same docker file, if you run it twice, do you get identical builds? </li>
<li>Docker imges from Dockerfiles are cached right? So an "apt-get update" in a dockerfile might result in two different builds if they are executed say, 1 week apart</li>
<li>Do the two setups produce same or different builds on <code>fn main()</code>?  This seems like a case where you can try <a href="https://en.wikipedia.org/wiki/Delta_debugging">https://en.wikipedia.org/wiki/Delta_debugging</a> via (3a) adding the dependencies one by one to the empty project, (3b) after all dependencies have been added, adding in the source, and seeing when the binaries first differ.</li>
</ol>



<a name="199945906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Any%20tips%20on%20debugging%20reproducible%20builds%3F/near/199945906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Any.20tips.20on.20debugging.20reproducible.20builds.3F.html#199945906">(Jun 05 2020 at 23:49)</a>:</h4>
<p>Have debugged a heck out of reproducibility problems under nix. Definitely possible to get reproducible builds, but I also doubt docker is good about giving you tools to do any such thing.</p>



<a name="199945981"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Any%20tips%20on%20debugging%20reproducible%20builds%3F/near/199945981" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Any.20tips.20on.20debugging.20reproducible.20builds.3F.html#199945981">(Jun 05 2020 at 23:50)</a>:</h4>
<p>diffoscope is a good tool to figure out what's different inside the binaries IIRC</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>